home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / conflict.0 / conflict / conflict-6.0 / os2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-12  |  1002 b   |  32 lines

  1. /******************************************************************************
  2.  * Copyright 1995 by Thomas E. Dickey.  All Rights Reserved.                  *
  3.  *                                                                            *
  4.  * You may freely copy or redistribute this software, so long as there is no  *
  5.  * profit made from its use, sale trade or reproduction. You may not change   *
  6.  * this copyright notice, and it must be included in any copy made.           *
  7.  ******************************************************************************/
  8. #ifndef NO_IDENT
  9. static char *Id = "$Id: os2.c,v 6.0 1995/03/12 02:02:26 dickey Rel $";
  10. #endif
  11.  
  12. #include "conflict.h"
  13.  
  14. #if SYS_OS2
  15. #include <dos.h>        /* ...for _getdrive/_setdrive */
  16.  
  17. int
  18. set_drive (char *name)
  19. {
  20.     if (have_drive(name)) {
  21.         unsigned want = name[0] - 'A' + 1;
  22.         unsigned have;
  23.         unsigned total;
  24.         _dos_setdrive(want, &total);
  25.         _dos_getdrive(&have);
  26.         if (want != have)
  27.             return FALSE;
  28.     }
  29.     return TRUE;
  30. }
  31. #endif    /* SYS_OS2 */
  32.